package com.xuan.webfinally.controller;


import com.xuan.webfinally.entity.LoginRequest;
import com.xuan.webfinally.service.ISysUserService;
import com.xuan.webfinally.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户信息表 前端控制器
 * </p>
 *
 * @author gyuxuan
 * @since 2025-05-18
 */
@RestController
@RequestMapping("/sys-user")
public class SysUserController {
    @Autowired
    private ISysUserService sysUserService;
    @PostMapping("/login")
    public Result<List<Map<String,String>>> login(@RequestBody LoginRequest loginRequest) {
        String username = loginRequest.getUsername();
        String password = loginRequest.getPassword();
        return sysUserService.login(username, password);
    }
}
